package cn.yuemouren.security.app.social;

import cn.yuemouren.security.core.social.TimiSpringSocialConfigurer;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

/**
 * @Author: Timi
 * @Description: TODO
 * @Date: 2020/7/4 19:30
 * @Version: v1.0
 */
public class SpringSocialConfigurerProcessor implements BeanPostProcessor {
    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        if(bean instanceof TimiSpringSocialConfigurer){
            TimiSpringSocialConfigurer configurer = (TimiSpringSocialConfigurer) bean;
            configurer.setFilterProcessUrl("/social/signUp");
        }
        return bean;
    }
}
